package hu.genius;

import hu.genius.view.ActionsListActivity;
import hu.genius.view.BasketActivity;
import hu.genius.view.MenuListActivity;
import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TabHost;

public class HelloTabWidget extends TabActivity implements OnClickListener {
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		
		Button backButton = (Button) findViewById(R.id.tabBackButton);
		backButton.setOnClickListener(this);

		Resources res = getResources(); 
		TabHost tabHost = getTabHost();
		TabHost.TabSpec spec;
		Intent intent;

		intent = new Intent().setClass(this, MenuListActivity.class);
		spec = tabHost
				.newTabSpec("menu")
				.setIndicator(getText(R.string.menu),
						res.getDrawable(R.drawable.ic_tab_artists))
				.setContent(intent);
		tabHost.addTab(spec);
		
		intent = new Intent().setClass(this, ActionsListActivity.class);
		spec = tabHost
				.newTabSpec("actions")
				.setIndicator(getText(R.string.actions),
						res.getDrawable(R.drawable.ic_tab_artists))
				.setContent(intent);
		tabHost.addTab(spec);
		
		intent = new Intent().setClass(this, BasketActivity.class);
		spec = tabHost
				.newTabSpec("basket")
				.setIndicator(getText(R.string.basket),
						res.getDrawable(R.drawable.ic_tab_artists))
				.setContent(intent);
		tabHost.addTab(spec);

		tabHost.setCurrentTab(0);
	}

	public void onClick(View v) {
		this.finish();
	}
	
}